home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 April / EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso / classx / util / xfa_util / arexx / imagefx_animtoxfa.rexx < prev    next >
OS/2 REXX Batch file  |  1998-03-09  |  3KB  |  87 lines

  1. /*
  2. ** Anim To XFA REQUESTER - ImageFX Arexx Script Converter
  3. ** This code shows how to open a File Requester
  4. ** For setting Input Anim Name and Output Anim Name.
  5. **
  6. ** This code (C)Copyright Fabio Rotondo.
  7. ** It is given as Freeware example and may not be used
  8. ** for any commercial product.
  9. **
  10. */
  11.  
  12. outname  = "RAM:T/Frame"
  13.  
  14. ADDRESS "IMAGEFX.1"      /* Let's ADDRESS ImageFX        */
  15. OPTIONS RESULTS
  16.  
  17. RequestFile '"Insert An Anim File To Convert"' 'RAM:' 'noname.anim' '#?'
  18. IF rc = 0 THEN
  19.     animname = result 
  20. ELSE
  21.     exit(RC)
  22. ENDIF
  23.  
  24. RequestFile '"Insert A Destination XFA Anim Name"' 'Ram:' 'a.xfa' '#?.xfa'
  25. IF rc = 0 THEN
  26.     XFAAnim = result
  27. ELSE
  28.     exit(RC)
  29. ENDIF
  30.  
  31. RequestNumber '"Insert Number Of Frames"' 100
  32. IF rc = 0 THEN
  33.     frames = result              /* Number of frames of the Anim */
  34. ELSE
  35.     exit(RC)
  36. ENDIF
  37.  
  38. LoadBuffer animname FORCE 1           /* Now we load the 1st Frame    */
  39. Render Go                             /* We render it into ImageFX    */
  40. Palette 8
  41. LockRange 0 On
  42.                                       /* And Lock The Palette next    */
  43.                                       /* Frames will be remapped is   */
  44.                                       /* We need it. (Multi pal anims)*/
  45.  
  46. SaveRenderedAs ILBM outname||0 FORCE    /* Save it into T:Frame0        */
  47.  
  48.  
  49. ADDRESS "XFA.1"          /* Now we call XFA (port is XFA.1)    */
  50. FirstFrame 0             /* We Set FirstFrame to 0             */
  51. LastFrame frames         /* We Set LastFrame to Anim Frames    */
  52. Compression 32I          /* Set Compression to  32I            */
  53. CloseAnim LOOP           /* Set AnimClose Mode to  LOOP        */
  54. InputName outname        /* Input Root Name is T:Frame         */
  55. OutputName XFAanim       /* XFA Animation Name will be T:a.xfa */
  56. SetProcessor ImageFX     /* We Select ImageProcessor Program   */
  57. InitXFA                  /* XFA Initialization                 */
  58.                          /* NOTE: BEFORE call InitXFA you have */
  59.                          /* To perform AT LEAST all settings   */
  60.                          /* We have done inside this example.  */
  61.                          /* Also remember of having the FIRST  */
  62.                          /* Frame of the ANIM saved as IFF, for*/
  63.                          /* Configuring correctly XFA          */
  64.  
  65.  
  66. DO t=1 TO frames                        /* For t=1 TO NFrames... */
  67.     ADDRESS "IMAGEFX.1"                 /* Call ImageFX          */
  68.     LoadBuffer animname FORCE t         /* Load Frame t          */
  69.     Render Go                           /* Render It             */
  70.     x = t-1                             /* Output File Name      */
  71.     n = outname||x
  72.     SaveRenderedAs ILBM n  FORCE        /* Save Picture          */
  73.  
  74.     ADDRESS "XFA.1"                     /* Call XFA              */
  75.     GetFrame (t-1)                      /* Load This Frame       */
  76.     PutFrame                            /* Put It Inside Anim    */
  77.  
  78. END                                     /* Next                  */
  79.  
  80. CloseXFA                                /* Here We Close XFA Anim*/
  81. Message '"Conversion done."'
  82.  
  83. ADDRESS "IMAGEFX.1"
  84. LockRange 0 Off
  85.  
  86. exit                                    /* End Of Arexx Script!! */
  87.